package org.feng.demo;

import org.feng.framework.*;

/**
 * 多例的bean，内部自动注入ProductService
 *
 * @version v1.0
 * @author: fengjinsong
 * @date: 2022年04月09日 14时46分
 */
@Scope("prototype")
@Component("userService")
public class UserService implements BeanNameAware, InitializingBean {

    @Autowird
    private ProductService productService;

    private String beanName;

    @Override
    public void setBeanName(String name) {
        this.beanName = name;
    }

    @Override
    public void afterPropertiesSet() {
        System.out.println(this + " 当前BeanName是：" + beanName);
        System.out.println(this + " 当前productService是：" + productService);
    }
}
